home *** CD-ROM | disk | FTP | other *** search
/ Super PC 34 / Super PC 34 (Shareware).iso / spc / UTIL / DJGPP2 / V2 / DJTST200.ZIP / tests / makefile.inc < prev    next >
Encoding:
Makefile  |  1995-11-12  |  975 b   |  65 lines

  1.  
  2. .SUFFIXES: .o .i .c .cc .s
  3.  
  4. GCC = gcc @$(TOP)/../gcc.opt -I. -I- -I$(TOP)/../../include $(CFLAGS) -c $<
  5.  
  6. %.o : %.c
  7.     $(GCC)
  8. %.o : %.cc
  9.     $(GCC)
  10. %.o : %.S
  11.     $(GCC)
  12.  
  13. %.i : %.c
  14.     $(GCC) -E > $@
  15. %.i : %.cc
  16.     $(GCC) -E > $@
  17. %.i : %.S
  18.     $(GCC) -E > $@
  19.  
  20. %.ss : %.c
  21.     $(GCC) -S > $@
  22. %.ss : %.cc
  23.     $(GCC) -S > $@
  24.  
  25. LIB = ${TOP}/../../lib
  26. BIN = ${TOP}/../../bin
  27.  
  28. C = ${LIB}/crt0.o
  29. L = ${LIB}/libc.a
  30.  
  31. EXES := $(addsuffix .exe, $(basename $(SRC)))
  32. ERRS := $(addsuffix .err, $(basename $(SRC)))
  33.  
  34. LINK = ld $(LDFLAGS) $^ -o $@ -T ${TOP}/../../lib/djgpp.lnk
  35. EXE = @${TOP}/../../bin/stubify.exe $@
  36.  
  37. .PRECIOUS: %.exe %.out %.err
  38.  
  39. %.exe : $C %.o ${EXTRA_LIBS} $L
  40.     $(LINK)
  41.     $(EXE)
  42.  
  43. %.out : %.exe
  44.     -$^ > $@
  45.  
  46. %.err : %.exp %.out
  47.     -diff $^ > $@
  48.     cat $@
  49.  
  50. all :: $(EXES)
  51.     @rem.com
  52.  
  53. tests :: $(ERRS)
  54.  
  55. testclean ::
  56.     -rm -f *.out *.err
  57.  
  58. clean :: testclean
  59.     -rm -f *.exe *.o *.d *.i
  60.  
  61. DEPS := $(wildcard *.d)
  62. ifneq ($(DEPS),)
  63. include $(DEPS)
  64. endif
  65.